home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE4 / ZAP / !Zap / Code / Config / CreateHelp < prev    next >
Text File  |  2002-09-24  |  10KB  |  344 lines

  1. CreateConf version 0.51 help file
  2. © Martin Ebourne, 1997
  3.  
  4. This program may only be distributed with Zap. The copyright conditions are
  5. as for Zap.
  6.  
  7. Introduction
  8. ============
  9.  
  10. CreateConf is designed to make installation of new Zap modules considerably
  11. easier, and the configuration files of Zap more logical. It takes the form of
  12. a specialised simple script language to allow complete user flexibility,
  13. allowing for instance the user to make a choice of maximum speed or maximum
  14. automation. Because it is a separate program Zap's executable is not
  15. increased in size with code that is only ever used once at startup.
  16.  
  17.  
  18. Invoking
  19. ========
  20.  
  21. CreateConf script commands can be supplied on the command line, in a script
  22. file, or both. All options are valid from both sources, and most options can
  23. be specified more than once to override previous settings. The options and
  24. constructs available are listed below.
  25.  
  26.  
  27. Options
  28. -------
  29.  
  30. -help
  31.   Display a brief reminder of the available options, and the version number.
  32.  
  33. -time
  34.   Cause the total execution time to be displayed when finished.
  35.  
  36. -debug
  37.   Enable verbose listings explaining what actions are being taken.
  38.  
  39. -pretend
  40.   Proceed as normal but do not actually execute or change any files. Useful
  41. to see what a script does without changing anything.
  42.  
  43. -script <file>
  44.   Take the remainder of the commands from the given script file. All
  45. remaining commands following the -script are ignored.
  46.  
  47. -cache <file>
  48.   Use the given file as a status cache to speed things up. The state of all
  49. the files combined to create a generated file is remembered and saved. Then
  50. in future the files are only regenerated if any of the source files have
  51. changed, or the output file has become corrupted or is missing.
  52.  
  53. -in <dir>
  54.   Use the given directory as the location of any <leaf> filenames that do not
  55. begin with '@.'.
  56.  
  57. -out <dir>
  58.   Use the given directory as the location of generated files.
  59.  
  60. -modules <dir>
  61.   Use the given directory as the location of the module applications, all of
  62. which are scanned for <leaf> filenames that begin with '@.'. The modules
  63. directory is scanned as this command is parsed so it is advisable to keep it
  64. within any conditional sections when possible.
  65.  
  66. -exec <leaf>
  67.   Execute given file(s). See <leaf> below.
  68.  
  69. ( <leaf> ... ) <name> <type>
  70.   Use the given <leaf> file(s) to create a file called <name> with filetype
  71. <type>.
  72.  
  73. -obey
  74.   Used before a <leaf> within ( ... ) to indicate that a line to set Obey$Dir
  75. as appropriate should be written out to the file. This is required if
  76. combining obey files to ensure that Obey$Dir is set as they expect it. Its
  77. effect applies to the next <leaf> parameter only.
  78.  
  79. -at
  80.   As for obey, except indicates that all occurences of '@' within the file
  81. should be translated to the fill path name of the directory. This is used for
  82. Zap's External files.
  83.  
  84. -ifkey <keynum> ... [-else ...] [-endif]
  85.   Conditional 'if' statement which bases its decision on whether or not the
  86. supplied key is currently pressed. -ifkey does not nest, but instead behaves
  87. as for BASIC's IF statement on a single line. Hence consecutive -ifkey's
  88. behave as an 'and' operator, a subsequent -else inverts all of them, and
  89. similarly a -endif cancels them all.
  90.  
  91. -country <sysvar>
  92.   Specifies a system variable containing the name of the country directory that
  93. internationalised files should be fetched from. If the file cannot be found in
  94. this directory, CreateConf will try UK followed by no directory prefix. Within
  95. Zap, this is set to the variable Zap$Country (set in ZapUser).
  96.  
  97.  
  98. Parameter types:
  99. --------- -----
  100.  
  101. <file>
  102.   Full pathname to a file.
  103.  
  104. <dir>
  105.   Full pathname to a directory, path variable directories (eg. ZapConfig:)
  106. acceptable.
  107.  
  108. <leaf>
  109.   Leaf name for an input file. If prefixed with '@.' then indicates the set
  110. of all files with this leaf name in any of the module applications. Without a
  111. prefix, indicates a file with this leaf name in the specified input
  112. directory, if it exists.
  113.  
  114. <name>
  115.   Leaf name for an output file, relative to the specified output directory.
  116.  
  117. <type>
  118.   Filetype number in hex.
  119.  
  120. <keynum>
  121.   Internal key number as listed on pages 1-849 and 1-850 of the RISC OS 3 PRM
  122. and used with OS_Byte 121, in its 2's complement form as with BASIC's INKEY.
  123.  
  124. <sysvar>
  125.   Name of a system variable, without angle brackets.
  126.  
  127.  
  128. Comments
  129. --------
  130.  
  131. Comments are only recognised in script files (ie. not on the command line),
  132. and run from a single '|' character to the end of the line. The '|' must be
  133. preceded by white space or be at the start of a line to be recognised.
  134.  
  135.  
  136. Standard files
  137. ======== =====
  138.  
  139. The following files are the ones used for a standard implementation of Zap.
  140. None of these is built into CreateConf, but they are detailed here because
  141. of their relevance.
  142.  
  143.  
  144. Input
  145. -----
  146.  
  147. The input directory is <Zap$Dir>.Config
  148.  
  149. External     - Basic Zap External as previously in External
  150. HelpData     - Basic Zap HelpData as previously in HelpData
  151. Keys         - Key definitions, as previously in Keys
  152. Menus        - Menus as previously in Menus
  153. Settings     - Config settings, as previously in Keys
  154. TypesHigh    - Zap type mappings which need to override all others, including
  155.                modules. Currently empty but useful for user customisation
  156. TypesLow     - Basic Zap type mappings, as previously in Keys. These have the
  157.                lowest precedence when working out which mode a file should be
  158.                loaded in
  159.  
  160.  
  161. Output
  162. ------
  163.  
  164. The output directory is ZapGenerated: (typically in !ZapUser)
  165.  
  166. !ZapBoot     - Merged !ZapBoot files from all of the modules. Used in
  167.                semi-automatic configuration
  168. !ZapRun      - Merged !ZapRun files from all of the modules. Used in
  169.                semi-automatic configuration
  170. Keys         - Merged Keys file
  171. HelpData     - Merged HelpData file
  172. Menus        - Zap menus file
  173. External     - Merged External file
  174.  
  175. It is also normal to use a cache file of ZapGenerated:RunCache
  176.  
  177.  
  178. Module application
  179. ------ -----------
  180.  
  181. The modules directory is <ZapModules$Dir>, normally <Zap$Dir>.Modules
  182.  
  183. A module application typically contains combinations of the following files:
  184.  
  185. !Boot        - Normal boot use
  186. !Help        - Normal help use, plus executed by Zap if user requests
  187.                detailed mode help (NOT YET!!!)
  188. !Run         - Normal run use. Not actually used when the module is executed,
  189.                and should report an error if the user tries it. Should reset
  190.                paths etc. though so the user can easily force a given
  191.                instantiation to be used
  192. !Setup       - Setup file for module, executed from the External file if
  193.                required
  194. !Sprites     - Normal sprites use
  195. !ZapBoot     - Obey file executed when Zap itself is booted
  196. !ZapRun      - Obey file executed when Zap is loading
  197. External     - Combined into main External file and should contain the usual
  198.                External file entries. Any '@' symbol is re-written as a
  199.                reference to the module's actual directory, so use @.Module
  200.                and @.!Setup to refer to the files in the directory
  201. HelpData     - Combined into main HelpData file and should contain the usual
  202.                HelpData file entries
  203. Types        - Combined into main Keys file and should contain the usual file
  204.                type and file name to mode mappings
  205. Menus        - Menus definition file which the module loads itself (via Zap)
  206. <ModuleName> - The actual module under its usual name
  207.  
  208. For speed reasons it is advisable not to include unnecessary files.
  209.  
  210.  
  211. Examples
  212. ========
  213.  
  214. There are two typical configurations of CreateConf for Zap. The first is the
  215. default and gives a good speed while retaining full automation. The second is
  216. an alternative for people who desire absolute maximum speed and are prepared
  217. to invoke manual file generation as required. As listed the files will be
  218. regenerated with the second version if and only if both Ctrl and Alt on the
  219. left hand side of the keyboard are held down while Zap loads.
  220.  
  221.  
  222. Automatic
  223. ---------
  224.  
  225. *** !Zap.!Boot:
  226. ...
  227. | Boot extension modules as appropriate
  228. Run <Zap$Dir>.Code.CreateConf -modules ZapModules: -exec @.!ZapBoot
  229. ***
  230.  
  231. *** !Zap.!Run:
  232. ...
  233. | Generate config files as appropriate
  234. CDir ZapGenerated:
  235. Run ZapCode:CreateConf -script ZapConfig:RunScript
  236. ...
  237. ***
  238.  
  239. *** !Zap.Config.RunScript
  240. | Fully automatic start up config script for Zap. Executes @.!ZapRun and
  241. | creates Keys, HelpData, Menus, and External
  242. | © Martin Ebourne, 1997. Only for distribution with Zap
  243.  
  244. -cache ZapGenerated:RunCache
  245. -in ZapConfig:
  246. -out <ZapGenerated$Write>
  247. -modules ZapModules:
  248. -country Zap$Country
  249. -exec @.!ZapRun
  250.  
  251. ( -obey !ZapRun
  252.   -obey @.!ZapRun
  253. ) !ZapRun feb
  254.  
  255. ( TypesHigh
  256.   @.Types
  257.   TypesLow
  258. ) Types fff
  259.   
  260. ( @.Keys
  261. ) Keys fff
  262.   
  263. -in ZapResources:
  264.   
  265. ( -at @.External
  266. ) External fff
  267.   
  268. ( HelpData
  269.   @.HelpData
  270. ) HelpData fff
  271.   
  272. ( Messages
  273.   @.Messages
  274. ) Messages fff
  275. ***
  276.  
  277.  
  278. Semi-automatic
  279. ---- ---------
  280.  
  281. *** !Zap.!Boot:
  282. ...
  283. | Boot extension modules as appropriate
  284. Run <Zap$Dir>.Code.CreateConf -in ZapGenerated: -exec !ZapBoot
  285. ***
  286.  
  287. *** !Zap.!Run:
  288. ...
  289. | Generate config files as appropriate
  290. CDir ZapGenerated:
  291. Run ZapCode:CreateConf -script ZapConfig:RunScriptS
  292. ...
  293. ***
  294.  
  295. *** !Zap.Code.RunScriptS
  296. | Manually invoked start up config script for Zap. If left Ctrl & left Alt
  297. | held down, creates !ZapBoot, !ZapRun, Keys, HelpData, Menus, and External.
  298. | Always executes !ZapRun
  299. | Martin Ebourne, 1997. Only for distribution with Zap
  300.  
  301. -country Zap$Country
  302.  
  303. -ifkey -5 -ifkey -6
  304.   -in ZapUser:Config
  305.   -out <ZapGenerated$Write>
  306.   -modules ZapModules:
  307.   
  308.   ( -obey !ZapRun
  309.     -obey @.!ZapRun
  310.   ) !ZapRun feb
  311.   
  312.   ( TypesHigh
  313.     @.Types
  314.     TypesLow
  315.   ) Types fff
  316.   
  317.   ( @.Keys
  318.   ) Keys fff
  319.   
  320.   -in ZapResources:
  321.   
  322.   ( -at @.External
  323.   ) External fff
  324.   
  325.   ( HelpData
  326.     @.HelpData
  327.   ) HelpData fff
  328.   
  329.   ( Messages
  330.     @.Messages
  331.   ) Messages fff
  332.  
  333. -endif
  334.  
  335. -in ZapGenerated:
  336. -exec !ZapRun
  337. ***
  338.  
  339.  
  340. Contacting
  341. ==========
  342.  
  343. See the help file for ZapMJE for details of contacting me.
  344.